<?php

use yii\helpers\Html;

/* @var $this yii\web\View */
/* @var $model app\models\Mdsparts */

$this->title = $model->title;

$labels = array(
    'Category','Category_sub','Category_sub_sub'
);
$this->params['breadcrumbs'][] = [
    'label' => $labels[$level],
    'url' => ['list','level'=>$level]
];
$this->params['breadcrumbs'][] = $this->title;

?>
<div class="mdsparts-update">

    <h1><?= Html::encode($this->title) ?></h1>

    <p>
        <?= Html::a('View',
            ['view', 'id' => $model->id,'level' => $level],
            ['class' => 'btn btn-primary'])
        ?>
        <?= Html::a('Delete',
            ['delete', 'id' => $model->id,'level' => $level],
            [
                'class' => 'btn btn-danger',
                'data' => [
                    'confirm' => 'Are you sure you want to delete this item?',
                    'method' => 'post',
                ],
            ]) ?>
    </p>


    <?= $this->render('_childCategory',[
        'childCategories' => $childCategories,
        'parentCategory' => $parentCategory,
        'level' => $level,
        'childLevel' => $childLevel,
        'parentLevel' => $parentLevel
    ]); ?>
    
    <?= $this->render('_form_update', [
        'model' => $model,
    ]) ?>

</div>
